<?php

namespace Admin\Models\statsexplain;

use Phalcon\Mvc\Model;
use Phalcon\Mvc\Model\Behavior\SoftDelete;
class ServiceDB extends Model
{

    const Prefix  = 'XHApp_';
    const Service = 'statsExplainDB';

    /**
     * 初始化软删除
     *
     * create by zsc 20170406
     */
    public function initialize()
    {
        $this->useDynamicUpdate(true);
        /*
        $this->addBehavior(new SoftDelete(
            array(
                'field' => 'status',
                'value' => 2,
            )
        ));
        */
    }

    /**
     * 设置统一表前缀
     *
     * @param $tableName
     * @return string
     *
     * create by zsc 20170406
     */
    public function getTableName($tableName)
    {
        return self::Prefix . $tableName;
    }


}